import configparser
import sys
import os

config = configparser.ConfigParser()
config.read('conf_service.ini',encoding='utf-8')
# config.read(os.path.join(os.getcwd(), 'conf_service.ini'))
# path = sys.argv[0].replace("httpServer.exe", "")
# config.read(path, encoding='utf-8')

def init():
    file = os.path.abspath(os.path.join(os.getcwd(), '.', 'conf_service.ini'))
    print(file)
    config.read(file)

def getValue(section, option):
    '''
    通过配置文件获取配置信息
    :param section:
    :param option:
    :return:
    '''
    return config.get(section, option)
